import request from '@/utils/request'
//查询企业的部门列表
export function getDepartment () {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
//查询部门负责人 
export function getEmployeesSimple () {
  return request({
    url: '/sys/user/simple',
    method: 'get'
  })
}
// 新增子部门
/**
 * 
 * @param {*} data  data的值有 code introduce manager name pid
 * @returns 
 */
export function addEmployeesSimple (data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 获取子部门详情
export function getDepartmentDetail (id) {
  return request({
    url: `/company/department/${id}`,
    methods: 'get'
  })
}
//编辑子部门
export function editDepartmentDetail (data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}
//删除子部门 /company/department/{id}
export function DelEmployeesSimple (id) {
  return request({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}